package com.csi.service;

import com.csi.domain.UserBook;
import org.apache.ibatis.annotations.Param;

import java.awt.print.Book;
import java.text.ParseException;
import java.util.List;
import java.util.Map;

public interface UserBookService {
    /**
     * 查询用户所有订单
     * @return
     */
    Map<String,Object> showUserBook(long hotelId);
    /**
     * 根据入住日、离店日、房型模糊查询可订几间房
     * @param roomId
     * @param check_time
     * @param leave_time
     * @return
     */
    int findRoomNum(int roomId, String check_time, String leave_time);

    /**
     * 根据房型Id查询预定页面酒店及房型信息
     * @param roomTypeId
     * @return
     */
    Map<String,Object> findByRoomTypeId4Info(int roomTypeId);

    /**
     * 添加订单(用户可选多个房间)
     * @param userId
     * @param checkTime
     * @param leaveTime
     * @param roomNum
     * @param price
     * @param phone
     * @param hotelId
     * @param roomTypeId
     * @return
     */
    int saveBook(long userId,String checkTime,String leaveTime,int roomNum,double price,String phone,long hotelId,long roomTypeId) throws ParseException;

    /**
     * 用户支付
     * @param userBook
     * @return
     */
    int payment(UserBook userBook);

    /**
     * 订单改为已完成
     * @param bookId
     * @return
     */
    int completed(long bookId);

    /**
     * 订单改为待评价
     * @param bookId
     * @return
     */
    int evaluated(long bookId);
}
